package cn.hyh.core.config;

import cn.hyh.core.component.CrosFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @auther :hyh
 * @desc :  其他的配置均放在这里
 * @date :2019/7/21
 */
@Configuration
public class AllConfig {

    //编码方式注册filter 通过filterRegistrationBean
     @Bean
    public FilterRegistrationBean  registrationBean(){
         FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
           filterRegistrationBean.setFilter(new CrosFilter());
           filterRegistrationBean.addUrlPatterns("/*");
         return filterRegistrationBean;
     }



}
